<template>
  <el-aside width="200px" class="aside">
    <el-menu :default-active="$route.path" exact 
    class="el-menu-vertical-demo" router>
      
      <NavItem v-for="v in items" :key="v.url" :item="v" :basePath="v.url" />

    </el-menu>

  </el-aside>
</template>

<script>
import NavItem from './NavItem'
export default {
  data() {
    return {
      //导航数据
      items: [
        { name: '首页', url: '/index' },
        { name: '数据管理', url: '/stats' },
        {
          name: '信息管理', url: '/wms',
          child: [{ name: '列表管理', url: '/wms/list' }]
        },
        {
          name: '用户管理', url: '/user',
          child:[
            {name:'用户统计',url:'/user/stats'},
            {name:'角色管理',url: '/user/role'}
          ] 
        },
      ]
    }
  },
  components:{NavItem},
  methods: {

  }
}
</script>

<style>
.el-header,
.el-footer {
  background-color: #B3C0D1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #D3DCE6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body>.el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
